﻿@using Webdiyer.WebControls.Mvc
@model Web.Controllers.SENDQuery
@{
    Layout = null;
    ViewBag.Nav = 5;
    int ti = 1;
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>短信发送记录查询</title>
    @Html.Partial("meta")
</head>
<body id="b_main">
    @Html.Partial("header")
    <!--/end #header-->
    <div id="wrapper">
        <!--/end #menu_main-->
        <div id="content">
            @Html.Partial("nav")

            @using (Html.BeginForm("index", "msg", FormMethod.Get, new { @class = "broom_form", id = "form0" }))
            {
                <table border="0" cellspacing="0" summary="table" class="broom_table">
                    <tbody>
                        <tr class="odd">
                            <td>姓 名
                               @Html.TextBoxFor(i => i.Name, new { @class = "inputbox" })
                            </td>
                            <td>电 话
                               @Html.TextBoxFor(i => i.Phone, new { @class = "inputbox" })
                            </td>
                            <td></td>
                        </tr>
                        <tr class="even">
                            <td colspan="2">
                                <table border="0" padding="0">
                                    <tr>
                                        <td style="border-right: 0px">发送时间 
                                        </td>
                                        <td style="border-right: 0px">
                                            <div class="rili">
                                                @Html.TextBox("BeginTime", Model != null && Model.BeginTime.HasValue ? Model.BeginTime.Value.ToString("yyyy-MM-dd") : null, new { @class = "inputbox date-pick", @readonly = "readonly" })
                                            </div>
                                        </td>
                                        <td style="border-right: 0px">至</td>
                                        <td style="border-right: 0px">
                                            <div class="rili">
                                                @Html.TextBox("EndTime", Model != null && Model.EndTime.HasValue ? Model.EndTime.Value.ToString("yyyy-MM-dd") : null, new { @class = "inputbox date-pick", @readonly = "readonly" })
                                            </div>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                            <td>
                                <input onclick=" $('form').first().submit(); return false; " type="submit" name="search"
                                    value="搜索短信发送记录" />
                            </td>
                        </tr>
                    </tbody>
                </table>
            }
            <br />
            <br />
            @if (ViewBag.List != null && ViewBag.List.Count > 0)
            {
                <table cellspacing="0" summary="table" class="broom_table">
                    <tbody>
                        <tr class="@((ti++) % 2 == 1 ? "odd" : "even")">
                            <td>姓名
                            </td>
                            <td>电话
                            </td>
                            <td>短信内容
                            </td>
                            <td>发送时间
                            </td>
                            <td>发送状态
                            </td>
                        </tr>
                        @foreach (var msg in ViewBag.List)
                        {
                            <tr class="@((ti++) % 2 == 1 ? "odd" : "even")">
                                <td>
                                    @msg.NAME
                                </td>
                                <td>
                                    @msg.PHONE
                                </td>
                                <td>
                                    @msg.CONTENT
                                </td>
                                <td>
                                    @msg.STIME
                                </td>
                                <td>
                                    @if (msg.STATE != null)
                                    {
                                        if (msg.STATE == "1")
                                        {
                                        @("成功")
                                        }
                                        else if (msg.STATE == "2")
                                        {
                                        @("失败")
                                        }
                                    }
                                </td>
                            </tr>
                        }
                    </tbody>
                </table>
            }
            else
            {
                <div class="container1">
                    <div class="notification error">
                        <a class="close" href="#"></a><em>
                            <img alt="" src="/assets/img/icons/cross_circle.png">无短信记录&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        </em>
                    </div>
                </div>
            }
            <div style="padding-left: 30px;">
                @Html.Pager((int)ViewBag.RecordCount, 10, (int)ViewBag.PageIndex, "index", "msg", null, null, null, new { @class = "pagination" })
            </div>
            <!--/end .tabber-->
        </div>
    </div>
    <div class="clear">
    </div>
</body>
</html>
